package com.csun.nusing.ui.fragment;

import android.content.Intent;
import android.view.View;
import android.widget.GridView;
import android.widget.ImageView;

import com.csun.nusing.R;
import com.csun.nusing.presenter.FragmentNursingOldrestPresenter;
import com.csun.nusing.presenter.inter.IBase;

/**
 * 守护佳的老人界面
 * ClassName: NursingOldsterFragment 
 * @Description: TODO
 * @author fzq
 * @date 2017-10-31
 */
public class NursingOldsterFragment extends
		BaseFragment<FragmentNursingOldrestPresenter> implements IBase {

	public static final int AddOlderCode = 21;//跳转添加界面
	private ImageView searchiv;
	private GridView recycleView;

	public NursingOldsterFragment() {
	}

	public static NursingOldsterFragment newInstance() {
		return new NursingOldsterFragment();
	}

	@Override
	public int getContentViewId() {
		return R.layout.fragment_nursing_oldrest;
	}

	// findView
	@Override
	public void initSubViews(View view) {
		super.initSubViews(view);
		findView(view);
		controlView();
	}

	/**
	 * 控制点击事件
	 * @Description: TODO
	 * @param    
	 * @return void  
	 * @throws
	 * @author fzq
	 * @date 2017-10-25
	 */
	private void controlView() {
	}

	/**
	 * 控件
	 * 
	 * @Description: TODO
	 * @param @param view
	 * @return void
	 * @throws
	 * @author fzq
	 * @date 2017-10-20
	 */
	private void findView(View view) {
		recycleView = view
				.findViewById(R.id.fragment_nursing_oldrest_gv);
		
//		view.findViewById(R.id.fragment_nursing_older_top_state_rl);
//		view.findViewById(R.id.fragment_nursing_older_top_time_rl);
//		view.findViewById(R.id.fragment_nursing_older_top_type_rl);
//		view.findViewById(R.id.fragment_nursing_older_top_other_rl);
//		
//		view.findViewById(R.id.fragment_nursing_older_top_state_tv);
//		view.findViewById(R.id.fragment_nursing_older_top_time_tv);
//		view.findViewById(R.id.fragment_nursing_older_top_type_tv);
//		view.findViewById(R.id.fragment_nursing_older_top_other_tv);
//		

	}

	// 交给presenter处理数据逻辑
	@Override
	public void initData() {
		super.initData();
		mPresenter.getOldListDate(getActivity(), recycleView);
	}

	@Override
	protected FragmentNursingOldrestPresenter getPresenter() {
		return new FragmentNursingOldrestPresenter(this);
	}

	
	/**
	 * 监听跳转的返回,在添加老人后返回,界面数据改变
	 */
	@Override
	public void onActivityResult(int requestCode, int resultCode, Intent data) {
		super.onActivityResult(requestCode, resultCode, data);
		if (requestCode == AddOlderCode) {
			
		}
	}
	
	
	
}
